<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>页面相关方法</title>
</head>
<body>
    <input type="text">
    <input type="button" value="按钮" onclick="f()">
    <div>div</div>
    <script>
       function f(){
         // 获取文本框
         let i = document.querySelector("input")
        // 获取div
        let d =document.querySelector("div")
        // 将文本框的值 去除赋值给div
        // 修改控件的值
        d.innerText = i.value
       }
    </script>
</body>
</html>